package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;
import com.itboye.mengwu.data.interfaces.IGuanzhuMeinterfaces;
import com.itboye.mengwu.data.model.PrivateXinMessgebean;
import com.itboye.mengwu.data.model.ZengBean;

public class ZengGuanzhurepository extends BaseNetRepository implements
		IGuanzhuMeinterfaces<ZengBean> {
	public static final String FocusMe = "BY_BbsUserCenter_focusMe";// 关注我的
	
	public static final String Private = "BY_Message_queryCall";// 私信用户
	String api = "100";

	public ZengGuanzhurepository(ICompleteListener listener) {
		super(listener);
	}

	@Override
	public void add(ZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(ZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(ZengBean model) {
		// TODO Auto-generated method stub

	}

	/**
	 * 关注我的
	 */
	@Override
	public void getInfo(ZengBean model) {
		Type type = new TypeToken<ZengBean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("uid", model.getUid());
		// params.put("count", model.getCount());
		// params.put("psku_id", model.getPsku_id());
		(new Builder<ZengBean>())
				.setTypeVerParamsAndReturnClass(FocusMe, apiVer, params, type)
				.requestListener(
						new BaseSuccessReqListener<ZengBean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();

	}

	@Override
	public List<ZengBean> queryYouHuiQuan(ZengBean model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void getPrivateMessage(String uid) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<PrivateXinMessgebean>() {
		}.getType();
		String apiVer = api;
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("uid", uid);
		// params.put("count", model.getCount());
		// params.put("psku_id", model.getPsku_id());
		(new Builder<PrivateXinMessgebean>())
				.setTypeVerParamsAndReturnClass(FocusMe, apiVer, params, type)
				.requestListener(
						new BaseSuccessReqListener<PrivateXinMessgebean>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

}
